<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增党员宣传报道登记')" />
    <th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-ad-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">党员：</label>
                <div class="col-sm-8">
             		<select id="member" class="form-control select2-multiple" name="memberId">
						<option th:each="member:${members}" th:value="${member.memberId}"
							th:text="${member.memberName}"></option>
					</select>
                   <!--  <input name="memberId" class="form-control" type="text" maxlength="10" required> -->
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">发表文章主题：</label>
                <div class="col-sm-8">
                	<textarea name="subject" maxlength="100" class="form-control" required placeholder="请填写发表文章主题"></textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">发表文章级别：</label>
                <div class="col-sm-8">
                    <select name="paperLevel" class="form-control m-b" th:with="type=${@dict.getType('paper_level')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">发表日期：</label>
                <div class="col-sm-8">
                    <input name="pubdate" class="form-control time-input" type="text" maxlength="10" required placeholder="请填写发表日期">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: select2-js" />
    <th:block th:include="include :: bootstrap-select-js" />
    <script th:inline="javascript">
        var prefix = ctx + "business/ad"
        $("#form-ad-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-ad-add').serialize());
            }
        }
        
        $(function(){
        	 $('#member').select2({
                 placeholder: "请选择党员",
                 allowClear: true
             });
        });
        
    </script>
</body>
</html>